<template>
  <!-- 顶部背景（可替换为实际背景图） -->
  <view class="me-header dark">
    <div class="me-header-view">
      <img
        :src="this.baseURL + bgImg"
        alt="背景图"
        class="tw-w-full tw-h-full tw-object-cover"
        @error="handleError"
        :class="{ hidden: no_img }"
      />
    </div>
  </view>
</template>
<script>
  import { handleError } from "vue";

  export default {
    name: "MeNav",
    props: {
      bgImg: {
        type: String,
        default: "/static/img/bg-me1.jpg", // 使用相对路径，由外部处理完整URL
      },
    },
    data() {
      return {
        no_img: false,
      };
    },
    methods: {
      handleError() {
        this.no_img = true;
      },
    },
  };
</script>

<style>
  .me-header-view {
    display: relative;
    width: 100%;
    height: 80px;
  }
</style>
